#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
int main()
{
    //C库函数
    printf("hello printf\n");
    fprintf(stdout, "hello fprintf\n");
    const char* message = "hello fwrite\n";
    fwrite(message, 1, strlen(message), stdout);


    //系统调用
    const char* w = "hello write\n";
    write(1, w, strlen(w));

    fork();
    //close(1);//先关闭原来的显示器流
    //int fd1 = open("log.txt", O_WRONLY | O_CREAT | O_TRUNC, 0666);
    //printf("hello world\n");
    //printf("fd1: %d",fd1);
    //fprintf(stdout, "helloworld\n");
    ////fflush(stdout);
    //close(fd1);

    return 0;
}
